<?php
//No direct access
defined('_JEXEC') or die('Restricted access');
?>

<div id="ownservices">
 <div id="mainmenuownservice"><?php echo MenuHelper::nav(); ?></div>
<div id="mainownservice">
<h3>
	<?php 
		if($this->row->id) { 
			echo JText::_('OWNSERVICE_EDIT_CURRENCY'); 
		} else { 
			echo JText::_('OWNSERVICE_NEW_CURRENCY'); 
		} 
	?>
</h3>
<hr />
<?php $row = $this->row; ?>
<script language="javascript" type="text/javascript">
	<!--
		function submitbutton(pressbutton)
		{
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			if (form.name.value == ""){
				alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_INPUT_CURRENCY_NAME', true ); ?>" );
			} else if (form.code.value == ""){
				alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_INPUT_EXCHANGERATE_CODE', true ); ?>" );
			} else {
				submitform( pressbutton );
			}
		}
	//-->
</script>
<form action="<?php echo JRoute::_('index.php?option=com_ownservice'); ?>" method="post" name="adminForm">
	<table class="admintable" width="100%">
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_CURRENCY_NAME'); ?></td>
			<td>
				<input type="text" name="name" value="<?php echo $row->name ?>" class="inputbox" style="width: 250px;" />
			</td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_PUBLISHED'); ?> <span class="red">*</span></td>
			<td>
				<?php
					$html = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published );
					echo $html;
				?>
			</td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_CURRENCY_CODE'); ?></td>
			<td>
				<input type="text" name="code" value="<?php echo $row->code ?>" class="inputbox" size="10" />
			</td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_CURRENCY_SIGN'); ?></td>
			<td>
				<input type="text" name="sign" value="<?php echo $row->sign ?>" class="inputbox" size="10" />
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center"><hr /></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
			<input type="button" name="save" value="<?php echo JText::_('OWNSERVICE_SAVE'); ?>" onClick="javascript: submitbutton('save')" />
			<input type="button" name="cancel" value="<?php echo JText::_('OWNSERVICE_CANCEL'); ?>" onClick="javascript: submitbutton('cancel')" />
			</td>
		</tr>
	</table>
	<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
	<input type="hidden" name="type" value="" />
	<input type="hidden" name="option" value="com_ownservice" />
	<input type="hidden" name="task" value="save" />
	<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid'); ?>" />
	<input type="hidden" name="controller" value="currency" />
	<input type="hidden" name="view" value="currency" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
</div>
</div>